home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
ccdl150l.zip
/
COMPLIB
/
68K
/
68DIVU.SRC
< prev
next >
Wrap
Text File
|
1996-12-14
|
505b
|
40 lines
section code
XDEF __divu,lludiv
__divu:
move (8,A7),D1
move (4,A7),D0
lludiv:
cmp.l d1,d0
beq.b retone
bpl.b retzer
movem.l d3/d4,-(A7)
clr.l d3
moveq #1,d4
lp1:
asl.l #1,d0
asl.l #1,d4
cmp.l d1,d0
bmi.b lp1
lp2:
lsr.l #1,d0
lsr.l #1,d4
beq.b done
sub.l d0,d1
bmi.b nosub
or.l d4,d3
bra.b lp2
nosub:
add.l d0,d1
bra.b lp2
done:
move.l d3,d0
movem.l (a7)+,d3/d4
rts
retzer:
clr.l d0
rts
retone:
clr.l d0
clr.l d1
addq.l #1,d0
rts